package com.auction.controller;

import com.auction.common.core.controller.MyBaseController;
import com.auction.common.dao.bean.PageResult;
import com.auction.common.utils.ReturnResult;
import com.auction.entity.Product;
import com.auction.entity.ProductInfo;
import com.auction.query.ProductInfoQuery;
import com.auction.service.ProductInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "寄售信息")
@RestController
@RequestMapping("/api")

public class ProductInfoController extends MyBaseController {
    @Autowired
    ProductInfoService productInfoService;

    @ApiOperation("添加寄售商品")
    @PostMapping("/add2")
    public ReturnResult saveInfo(@RequestBody ProductInfo productInfo){
        int rs=productInfoService.saveEntity(productInfo);
        return saveResult(rs);
    }

//    @ApiOperation("查询寄售信息")
//    @PostMapping("/query2")
//    public ReturnResult queryInfo(@RequestBody ProductInfoQuery productInfoQuery){
//        PageResult result=productInfoService.queryByPage(productInfoQuery);
//        return success("查询寄售信息",result);
//
//    }

    @ApiOperation("修改商品")
    @PutMapping("/update2")
    public ReturnResult updateInfo(@RequestBody ProductInfo productInfo){
        int rs=productInfoService.updateEntity(productInfo);
        return updateResult(rs);
    }




}
